<template>
  <div class="service-card" :class="className" :style="style">
    <div class="icon">
      <span class="material-symbols-outlined"> {{ icon }} </span>
    </div>
    <div class="content">
      <div class="name">{{ name }}</div>
      <div class="org">{{ org }}</div>
    </div>
    <div class="close" v-if="showClose">
      <span class="material-symbols-outlined"> close </span>
    </div>
  </div>
</template>

<script setup>
import { defineProps, toRefs } from 'vue'
const props = defineProps(['icon', 'name', 'org', 'showClose', 'style', 'className'])
const { icon, name, org, showClose, style, className } = toRefs(props)
</script>

<style lang="scss" scoped>
.service-card {
  width: 100%;
  height: dpi(15rem);
  cursor: pointer;
  background: #f5f5f5;

  display: flex;
  align-items: center;
  column-gap: 20px;
  padding: 0 20px;
  .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('../../assets/images/duobianxing-blue.png');
    background-size: 100%;
    width: 50px;
    height: 44px;
    > span {
      color: #fff;
      font-size: 24px;
    }
  }
  .content {
    flex: 1;
    .name {
      font-family: PingFangSC-Semibold;
      font-size: dpi(3rem);
      letter-spacing: 1px;
      color: #05204d;
      margin-bottom: 8px;
    }
    .org {
      font-family: PingFangSC-Regular;
      font-size: dpi(2rem);
      letter-spacing: 0px;
      color: #888888;
    }
  }

  .close {
    width: 20px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    > span {
      color: #05204d;
      opacity: 0.5;
      font-size: 18px;
    }
    &:hover {
      > span {
        opacity: 1;
      }
    }
  }
}
</style>
